package com.tio.demo;

import java.nio.Buffer;
import java.nio.ByteBuffer;

/**
 * Author      : liyuemin
 * Time        : 2017/12/14 11:25
 * Description :
 */
public class BufferExercise {
    public static  void main(String[] args ){
        /*ByteBuffer buffer = ByteBuffer.allocate(10240);
        System.out.println(buffer.position());
        System.out.println(buffer.limit());
        System.out.println(buffer);
        byte [] ste = new byte[30];
        byte a = 'a';
        buffer.put(ste);
        System.out.println(buffer.position());
        System.out.println(buffer.limit());
        System.out.println(buffer);
        //在该缓冲区的当前位置读取下一个4字节在该缓冲区的当前位置读取下一个4字节，按照当前字节顺序将它们组合成一个int值，然后将位置增加4。
        System.out.println("getInt:"+buffer.getInt());
        System.out.println("limit:"+buffer.limit());
        System.out.println("get(byte);"+buffer.get(ste));
        System.out.println("position:"+buffer.position());*/
        System.out.print(getname());
    }
    public static String getname(){
        String str = "111";
        try {

            System.out.print(str);

            return "3333";
        }finally {
            str = "222";
            System.out.print(str);
        }

    }
}
